#!/usr/bin/env bash
# Runs the compiled program, building it first on a clean checkout.
set -euo pipefail
root="$(cd "$(dirname "${BASH_SOURCE[0]}")/.." && pwd)"
if [ ! -x "$root/build/app" ]; then
  ( cd "$root" && mkdir -p build && ldc2 -i -O -Isource -of=build/app source/app.d >&2 )
fi
exec "$root/build/app" "$@"
